﻿using RedmineTypes = Redmine.Net.Api.Types;

namespace Redmine.Laptop.API.Models
{
    public class IssuePriority
    {
        public int PriorityID { get; set; }
        public string PriorityName { get; set; }
        public bool IsDefault { get; set; }

        public static explicit operator RedmineTypes::IssuePriority(IssuePriority issuePriority)
        {
            return new RedmineTypes::IssuePriority
            {
                Id = issuePriority.PriorityID,
                Name = issuePriority.PriorityName,
                IsDefault = issuePriority.IsDefault
            };
        }

        public static explicit operator IssuePriority(RedmineTypes::IssuePriority issuePriority)
        {
            return new IssuePriority
            {
                IsDefault = issuePriority.IsDefault,
                PriorityID = issuePriority.Id,
                PriorityName = issuePriority.Name
            };
        }
    }
}
